package cn.tedu.boke.portal.vo;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author Xdoor
 * @version 1.0
 * @date 2021/10/31 19:30
 */

@Data
public class RegisterVo implements Serializable
{
    //message就是当本属性为空时,输出的错误信息
    @NotBlank(message = "昵称不能为空")//昵称不能为空
    @Pattern(regexp = "^.{2,10}$", message = "昵称是2~10位字符")
    private String nickname;   //昵称

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[0-9a-zA-Z]{5,15}$", message = "用户名格式不正确")
    private String username;      //用户名

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{5,20}$", message = "密码是6~20个字符")
    private String password;   //密码

    @NotBlank(message = "确认密码不能为空")
    private String confirm;    //确认密码

}